package com.glela.controller;

import java.util.Date;
import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSONObject;
import com.glela.task.domain.TaskOrderParams;
import com.glela.task.domain.TaskOrderStatus;
import com.glela.task.domain.TaskOrderType;
import com.glela.task.model.TaskOrder;
import com.glela.task.service.TaskOrderService;

@Controller
@RequestMapping("taskOrder")
public class TaskOrderController {
	private static Logger logger = LoggerFactory.getLogger(TaskOrderController.class);

	@Autowired
	private TaskOrderService taskOrderService;

	@RequestMapping(value = "/divide")
	public @ResponseBody Object divide(TaskOrderParams taskOrderParams) {
		taskOrderParams.setTaskType(TaskOrderType.CALCULATION_COMMISSION_SETTLEMENT.getTaskType());
		taskOrderParams.setTaskStatus(TaskOrderStatus.UNTREATED.getTaskStatus());
		taskOrderParams.setTimeProcess(new Date());
		//		taskOrderParams.setPageNum(2);
		//		taskOrderParams.setPageSize(10);
		List<TaskOrder> queryAll = taskOrderService.queryAll(taskOrderParams);
		logger.warn("{}", JSONObject.toJSONString(queryAll));
		return null;
	}
}